<?php
header("content-type:text/html;charset=utf8");
$pdo = new PDO("mysql:host=127.0.0.1;dbname=11-9;charset=utf8;",'root','root');
$sql = "select * from excel";

$res = $pdo->query($sql);

$data = $res->fetchAll(PDO::FETCH_ASSOC);
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<center>
    <table border="1">
        <tr>
            <td>id</td>
            <td>名字</td>
            <td>密码</td>
            <td>确认密码</td>
            <td>真实姓名</td>
            <td>工资</td>
        </tr>
        <?php foreach ($data as $k => $v){?>
        <tr>
            <td><?php echo $v['id']?></td>
            <td><?php echo $v['name']?></td>
            <td><?php echo $v['pwd']?></td>
            <td><?php echo $v['rpwd']?></td>
            <td><?php echo $v['rname']?></td>
            <td><?php echo $v['gz']?></td>

        </tr>
        <?php }?>

    </table>
    <a href="daochu.php?id=<?php echo $v['id']?>"><button>导出</button></a>
</center>
</body>
</html>
